using System.IO;
using UnityEditor;
using UnityEngine;

public static partial class SerializeHelper
{
    public static string logicProtoOutputPath => protectPath + "/ProtoGen/Proto/Logic";
    public static string logicDataScriptsDirectory =>Path.Combine(Application.dataPath , "0A2_Scripts/Shared/LogicData");
    
    [MenuItem("Data/GenerateLogicDataProtobuf3")]
    static void GenerateLogicDataProtobuf3()
    {
        string preText = "";
        preText += "using Google.Protobuf;\n";
        preText += "using Google.Protobuf.Collections;\n";
        preText += "using Google.Protobuf.Reflection;\n";
        preText += "using System.Collections.Generic;\n";

        GenerateProtobuf(3, preText, "","LogicData",logicDataScriptsDirectory,logicProtoOutputPath,cSharpTempOutputPath);
        
        ConstDataJsonHelper.GenerateConstDataTable("LogicData",logicDataScriptsDirectory);
        ConstDataJsonHelper.GenerateConstData_ReadFromTable("LogicData",logicDataScriptsDirectory);
    }
    
    
    static string serializeProtoOutputPath => protectPath + "/ProtoGen/Proto/Serialize";
    static string serializeDataScriptsDirectory =>Path.Combine(Application.dataPath , "0A2_Scripts/Shared/Serialize");
    
    [MenuItem("Data/GenerateSerializeDataProtobuf3")]
    static void GenerateSerializeDataProtobuf3()
    {
        string preText = "";
        preText += "using Google.Protobuf;\n";
        preText += "using Google.Protobuf.Collections;\n";
        preText += "using Google.Protobuf.Reflection;\n";
        preText += "using System.Collections.Generic;\n";

        GenerateProtobuf(3, preText, "","Serialize",serializeDataScriptsDirectory,serializeProtoOutputPath,cSharpTempOutputPath);
        
    }
}